<template>
	<view>
		<view class="flexView">
			<van-icon name="https://b.yzcdn.cn/vant/icon-demo-1126.png" size="3rem" />
			<view class="nickName" v-text="nickName"></view>
		</view>
		<van-grid column-num=2>
			<van-grid-item icon="shop-o" text="我的评论" url="/pages/review/review" />
			<van-grid-item icon="apps-o" text="外卖垃圾分类" @click="onClick" />
			<van-grid-item icon="setting-o" text="设置" url="/pages/setting/setting" />
			<van-grid-item icon="info-o" text="关于" url="/pages/about/about" />
		</van-grid>
		<view class="safeView"></view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				nickName:''
			}
		},
		onLoad(){
			const that=this;
		},
		onShow(){
			const that=this;
			wx.showNavigationBarLoading();
			wx.request({
				url:that.myConfig.apiUrl+'/getNickname.php',
				data:{
					openId:that.myConfig.openId
				},
				success:function(res){
					wx.hideNavigationBarLoading();
					that.nickName=res.data.nickName;
				},
				fail:function(){
					wx.hideNavigationBarLoading();
					that.myConfig.err();
				}
			});
		},
		methods:{
			onClick(){
				wx.navigateToMiniProgram({
				  appId: 'wx6985d1c8d0ab3725'
				});
			}
		}
	}
</script>

<style scoped>
	.nickName{
		font-size: 50rpx;
		color: #33333;
	}
	.flexView{
		display: flex;
		align-items: center;
		justify-content: center;
		padding-top: 50rpx;
		padding-bottom: 100rpx;
	}
</style>
